package com.qzsoft.zhjd.asphalt.modules.asphaltdataweight.controller;

import java.util.Map;

import com.qzsoft.zhjd.asphalt.modules.asphaltdataweight.dto.AsphaltDataWeightDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltdataweight.dto.ProduceWeightDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltdataweight.service.AsphaltDataWeightService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import com.qzsoft.zhjd.common.utils.ResultUtils;

/**
 * @ClassName AsphaltDataWeightController
 * @Description 重量控制器
 * @author linhuawei
 * @since 2021-12-04
 */
@RestController
@RequestMapping("/api/asphaltDataWeight")
public class AsphaltDataWeightController {

    @Autowired
    private AsphaltDataWeightService asphaltDataWeightService;

    /**
     * @Title page
     * @Description 获取重量分页数据
     * @param params 查询条件
     * @return 重量分页数据
     */
    @RequiresPermissions("api:asphaltData:productmoninter")
    @GetMapping("/page")
    public Result<IPage<AsphaltDataWeightDto>> page(@RequestParam Map<String, Object> params) {
        IPage<AsphaltDataWeightDto> page = asphaltDataWeightService.pageDto(params);
        return ResultUtils.ok(page);
    }

    /**
     * @Title weightPage
     * @Description 总量校核
     * @param params 查询条件
     * @return 生产重量
     */
    @RequiresPermissions("api:asphaltDataWeight:produceWeight")
    @GetMapping("/produceWeight")
    public Result<IPage<ProduceWeightDto>> produceWeight(@RequestParam Map<String, Object> params) {
        IPage<ProduceWeightDto> page = asphaltDataWeightService.produceWeight(params);
        return ResultUtils.ok(page);
    }

}
